package com.world.wifi.service.impl;

import java.util.List;
import com.world.common.utils.DateUtils;
import com.world.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.world.wifi.mapper.WifiFlowMapper;
import com.world.wifi.domain.WifiFlow;
import com.world.wifi.service.IWifiFlowService;

/**
 * 流量Service业务层处理
 * 
 * @author LiJunXi
 * @date 2025-05-27
 */
@Service
public class WifiFlowServiceImpl implements IWifiFlowService 
{
    @Autowired
    private WifiFlowMapper wifiFlowMapper;

    /**
     * 查询流量
     * 
     * @param flowId 流量主键
     * @return 流量
     */
    @Override
    public WifiFlow selectWifiFlowByFlowId(Long flowId)
    {
        return wifiFlowMapper.selectWifiFlowByFlowId(flowId);
    }

    /**
     * 查询流量列表
     * 
     * @param wifiFlow 流量
     * @return 流量
     */
    @Override
    public List<WifiFlow> selectWifiFlowList(WifiFlow wifiFlow)
    {
        return wifiFlowMapper.selectWifiFlowList(wifiFlow);
    }

    /**
     * 新增流量
     * 
     * @param wifiFlow 流量
     * @return 结果
     */
    @Override
    public int insertWifiFlow(WifiFlow wifiFlow)
    {
        wifiFlow.setUserId(SecurityUtils.getUserId());
        wifiFlow.setCreateTime(DateUtils.getNowDate());
        return wifiFlowMapper.insertWifiFlow(wifiFlow);
    }

    /**
     * 修改流量
     * 
     * @param wifiFlow 流量
     * @return 结果
     */
    @Override
    public int updateWifiFlow(WifiFlow wifiFlow)
    {
        return wifiFlowMapper.updateWifiFlow(wifiFlow);
    }

    /**
     * 批量删除流量
     * 
     * @param flowIds 需要删除的流量主键
     * @return 结果
     */
    @Override
    public int deleteWifiFlowByFlowIds(Long[] flowIds)
    {
        return wifiFlowMapper.deleteWifiFlowByFlowIds(flowIds);
    }

    /**
     * 删除流量信息
     * 
     * @param flowId 流量主键
     * @return 结果
     */
    @Override
    public int deleteWifiFlowByFlowId(Long flowId)
    {
        return wifiFlowMapper.deleteWifiFlowByFlowId(flowId);
    }
}
